﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Security.Cryptography;
using System.IO;
using System.ComponentModel;
using System.Reflection;

namespace Utils
{

    public static class Extend
    {

        #region 各种类型转成字符串
        //包括日期、时间、钱

        /// <summary>
        /// yyyy-MM-dd HH:mm:ss
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public static string ToDateTimeStr(this DateTime dt)
        {
            return dt.ToString("yyyy-MM-dd HH:mm:ss");
        }

        /// <summary>
        /// yyyy.MM.dd HH:mm
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public static string ToShowDateTimeStr(this DateTime dt)
        {
            return dt.ToString("yyyy.MM.dd HH:mm");
        }

        /// <summary>
        /// yyyy-MM-dd
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public static string ToDateStr(this DateTime dt)
        {
            return dt.ToString("yyyy-MM-dd");
        }

        /// <summary>
        /// HH:mm:ss
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public static string ToTimeStr(this DateTime dt)
        {
            return dt.ToString("HH:mm:ss");
        }

        /// <summary>
        /// 价格转字符串，保留两位小数点
        /// </summary>
        /// <param name="price"></param>
        /// <returns></returns>
        public static string ToPriceStr(this decimal price)
        {
            return price.ToString("f2");
        }

        /// <summary>
        /// 价格转字符串，去掉后面无效的0
        /// </summary>
        /// <param name="price"></param>
        /// <returns></returns>
        public static string ToPriceStr2(this decimal price)
        {
            return price.ToString("G0");
        }
        /// <summary>
        /// 价格转字符串，去掉后面无效的0,2位4舍5入。
        /// </summary>
        /// <param name="price"></param>
        /// <returns></returns>
        public static string ToPriceStr22(this decimal price)
        {
            return Math.Round(price, 2, MidpointRounding.AwayFromZero).ToString("G0");
        }
        #endregion


        public static List<long> ToLongList(this IList<object> objList)
        {
            List<long> temp = new List<long>();
            foreach (object obj in objList)
            {
                temp.Add(obj.ConToLong());
            }
            return temp;
        }

        public static List<string> ToStringList(this IList<object> objList)
        {
            List<string> temp = new List<string>();
            foreach (object obj in objList)
            {
                temp.Add(obj.ToString());
            }
            return temp;
        }


        public static List<bool> ToBoolList(this IList<object> objList)
        {
            List<bool> temp = new List<bool>();
            foreach (object obj in objList)
            {
                temp.Add(obj.ConToBool(false));
            }
            return temp;
        }

        /// <summary>
        /// 根据分隔符，将字符串解析成long类型集合
        /// </summary>
        /// <param name="str"></param>
        /// <param name="separate"></param>
        /// <returns></returns>
        public static List<long> ToLongList(this string str, string separate)
        {
            List<long> list = new List<long>();
            if (!string.IsNullOrEmpty(str))
            {
                var strIds = str.Split(separate);
                foreach (var item in strIds)
                {
                    list.Add(item.ConToLong(0));
                }
            }
            return list;
        }

        #region 类型转换

        /// <summary>
        /// 转换成Long型
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static long ConToLong(this object str)
        {
            long result = 0;
            if (str != null)
            {
                long.TryParse(str.ToString(), out result);
            }
            return result;
        }

        /// <summary>
        /// 转换成Int型
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static int ConToInt(this object str)
        {
            int result = 0;
            if (str != null)
            {
                int.TryParse(str.ToString(), out result);
            }
            return result;
        }

        /// <summary>
        /// 转换成Long型
        /// </summary>
        /// <param name="errorReturn">设置转不过去的时候返回的值</param>
        /// <returns></returns>
        public static long ConToLong(this object str, int errorReturn)
        {
            long result = errorReturn;
            if (str != null)
            {
                long.TryParse(str.ToString(), out result);
            }
            return result;
        }

        /// <summary>
        /// 转换成Int型
        /// </summary>
        /// <param name="str"></param>
        /// <param name="errorReturn">设置转不过去的时候返回的值</param>
        /// <returns></returns>
        public static int ConToInt(this object str, int errorReturn)
        {
            int result = errorReturn;
            if (str != null)
            {
                if (!int.TryParse(str.ToString(), out result))
                {
                    return errorReturn;
                }
            }
            return result;
        }

        /// <summary>
        /// 转换成bool值
        /// </summary>
        /// <param name="str"></param>
        /// <param name="defaultVaue"></param>
        /// <returns></returns>
        public static bool ConToBool(this object str, bool defaultVaue)
        {
            bool temp = defaultVaue;
            if (str != null)
            {
                if (!bool.TryParse(str.ToString(), out temp))
                {
                    return defaultVaue;
                }
            }
            return temp;
        }

        /// <summary>
        /// 转换double类型
        /// </summary>
        /// <param name="str"></param>
        /// <param name="val">转换不成功的时候,期望返回的值</param>
        /// <returns></returns>
        public static double ConToDouble(this object str, double val)
        {
            double temp = val;
            if (str != null)
            {
                if (!double.TryParse(str.ToString(), out temp))
                {
                    return val;
                }
            }
            return temp;
        }

        public static double ConToDouble(this object str)
        {
            double result = 0.0;
            if (str != null)
            {
                double.TryParse(str.ToString(), out result);
            }
            return result;
        }


        /// <summary>
        /// 转换decimal类型
        /// </summary>
        /// <param name="str"></param>
        /// <param name="val">转换不成功的时候,期望返回的值</param>
        /// <returns></returns>
        public static decimal ConToDecimal(this object str, decimal val)
        {
            decimal temp = val;
            if (str != null)
            {
                if (!decimal.TryParse(str.ToString(), out temp))
                {
                    return val;
                }
            }
            return temp;
        }

        /// <summary>
        /// 转换decimal类型
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static decimal ConToDecimal(this object str)
        {
            decimal temp = 0.0M;
            if (str != null)
            {
                decimal.TryParse(str.ToString(), out temp);
            }
            return temp;
        }

        /// <summary>
        /// 转换成DateTime值
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static DateTime ConToDateTime(this object str, DateTime dt)
        {
            DateTime result = dt;
            if (str != null)
            {
                if (!DateTime.TryParse(str.ToString(), out result))
                {
                    return dt;
                }
            }
            return result;
        }


        ///// <summary>
        ///// 将时间转为long型的时间戳
        ///// </summary>
        ///// <param name="dt"></param>
        ///// <returns></returns>
        //public static long ConToLongFromDateTime(this DateTime dt)
        //{
        //    TimeSpan ts = new TimeSpan(dt.Ticks - new DateTime(1970, 1, 1, 0, 0, 0).Ticks);
        //    return (long)ts.TotalMilliseconds;
        //}

        ///// <summary>
        ///// 将long型时间戳转为时间
        ///// </summary>
        ///// <param name="longDate"></param>
        ///// <returns></returns>
        //public static DateTime ConToDateTimeFromLong(this long longDate)
        //{
        //    DateTime sysTime = DateTime.Parse("1970-01-01 08:00:00").AddMilliseconds(longDate);
        //    return sysTime;
        //}


        /// <summary>
        /// DateTime时间格式转换为Unix时间戳格式 
        /// </summary>
        /// <param name=”time”></param>
        /// <returns></returns>
        public static long ConvertDateTimeToUnixTimestamp(this DateTime dateTime)
        {
            System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1, 0, 0, 0, 0));//8小时北京时间
            long t = (dateTime.Ticks - startTime.Ticks) / 10000;            //除10000调整为13位
            return t;
        }

        /// <summary>
        /// Unix时间戳格式转换为DateTime时间格式
        /// </summary>
        /// <param name=”time”></param>
        /// <returns></returns>
        public static DateTime ConvertUnixTimeStampToDateTime(this long unixTimeStamp)
        {
            // 定义其实时间
            System.DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0).ToLocalTime(); //8小时北京时间
            dtDateTime = dtDateTime.AddSeconds(Convert.ToInt64(unixTimeStamp) / 1000);//
            return dtDateTime;
        }
        #endregion


        /// <summary>
        /// 去掉HTML标签
        /// </summary>
        /// <param name="content"></param>
        /// <returns></returns>
        public static string RemoveHTMLTag(this string content)
        {
            if (content == null) { return null; }
            return System.Text.RegularExpressions.Regex.Replace(content, "<[^>]*>", string.Empty, System.Text.RegularExpressions.RegexOptions.IgnoreCase).Replace("&nbsp;", string.Empty);
        }

        /// <summary>
        /// 使用正则分割
        /// </summary>
        /// <param name="str"></param>
        /// <param name="reg"></param>
        /// <returns></returns>
        public static string[] Split(this string str, string reg)
        {
            if (string.IsNullOrEmpty(str))
            {
                return new string[0];
            }
            return System.Text.RegularExpressions.Regex.Split(str, reg, System.Text.RegularExpressions.RegexOptions.Multiline);
        }

        /// <summary>
        /// 正则是否匹配,忽略大小写
        /// </summary>
        /// <param name="reg">正则</param>
        /// <returns></returns>
        public static bool IsMatch(this string str, string reg)
        {
            return Regex.IsMatch(str, reg, RegexOptions.IgnoreCase | RegexOptions.Multiline);
        }

        /// <summary>
        /// 截取指定长度的字符串，如果字符串长度不够直接返回
        /// </summary>
        /// <param name="str"></param>
        /// <param name="length">截取的长度</param>
        /// <returns></returns>
        public static string MySubString(this string str, int length, bool showPoints = false)
        {
            if (str == null)
            {
                return null;
            }
            if (length > str.Length)
            {
                return str;
            }
            if (length < str.Length)
            {
                if (showPoints)
                {
                    return str.Substring(0, length) + "...";
                }
                else
                {
                    return str.Substring(0, length);
                }
            }
            return str;
        }

        /// <summary>
        /// 从字符串的指定位置截取指定长度的子字符串
        /// </summary>
        /// <param name="str">原字符串</param>
        /// <param name="startIndex">子字符串的起始位置</param>
        /// <param name="length">子字符串的长度</param>
        /// <returns>子字符串</returns>
        public static string CutString(this string str, int startIndex, int length)
        {
            if (str == null)
            {
                return null;
            }
            if (startIndex >= 0)
            {
                if (length < 0)
                {
                    length = length * -1;
                    if (startIndex - length < 0)
                    {
                        length = startIndex;
                        startIndex = 0;
                    }
                    else
                    {
                        startIndex = startIndex - length;
                    }
                }


                if (startIndex > str.Length)
                {
                    return "";
                }


            }
            else
            {
                if (length < 0)
                {
                    return "";
                }
                else
                {
                    if (length + startIndex > 0)
                    {
                        length = length + startIndex;
                        startIndex = 0;
                    }
                    else
                    {
                        return "";
                    }
                }
            }

            if (str.Length - startIndex < length)
            {
                length = str.Length - startIndex;
            }

            return str.Substring(startIndex, length);
        }

        /// <summary>
        /// 从字符串的指定位置开始截取到字符串结尾的了符串
        /// </summary>
        /// <param name="str">原字符串</param>
        /// <param name="startIndex">子字符串的起始位置</param>
        /// <returns>子字符串</returns>
        public static string CutString(this string str, int startIndex)
        {
            return CutString(str, startIndex, str.Length);
        }


        public static string ToStr(this bool bl)
        {
            if (bl) { return "是"; } else { return "否"; }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="bl"></param>
        /// <param name="trueStr">如果是真输出的字符</param>
        /// <param name="falseStr">如果是假输出的字符</param>
        /// <returns></returns>
        public static string ToStr(this bool bl, string trueStr, string falseStr)
        {
            if (bl)
            {
                return trueStr;
            }
            else
            {
                return falseStr;
            }
        }

        /// <summary>
        /// 判断是否是当天时间
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public static bool IsToDay(this DateTime dt)
        {
            if (dt != null)
            {
                DateTime now = DateTime.Now;
                return now.Year == dt.Year && now.Month == dt.Month && now.Day == dt.Day;
            }
            return false;
        }

        /// <summary>
        /// 给手机号码打上马赛克，只显示后面4位数
        /// </summary>
        /// <param name="number"></param>
        /// <returns></returns>
        public static string MaskPhone(this string number)
        {
            string resultStr = number;
            if (number != null && number.Length == 11)
            {
                //号码段取三位133、153等…
                string prefixStr = number.Substring(0, 3);
                //号码段后的号码
                string suffixStr = number.Substring(number.Length - 4, 4);
                resultStr = prefixStr + GetMaskString(4) + suffixStr;
            }
            return resultStr;
        }


        /// <summary>
        /// 给邮箱地址打上马赛克
        /// </summary>
        /// <returns></returns>
        public static string MaskEmail(this string email)
        {
            string resultStr = email;
            if (email != null)
            {
                //@前的字符数
                int preCount = email.IndexOf("@");
                if (preCount > 0)
                {
                    //前缀字符串
                    string prefixStr = email.Substring(0, preCount);
                    //后缀字符串
                    string suffixStr = email.Substring(preCount, (email.Length - preCount));
                    int maskCount = prefixStr.Length;
                    //如果前缀为奇数
                    if ((preCount % 2) != 0)
                    {
                        maskCount = (preCount + 1) / 2;
                    }
                    else
                    {
                        maskCount = preCount / 2;
                    }
                    prefixStr = prefixStr.Substring(maskCount, prefixStr.Length - maskCount);
                    resultStr = GetMaskString(maskCount) + prefixStr + suffixStr;
                }
            }
            return resultStr;
        }

        /// <summary>
        /// 根据数量，获取*号表示的字符串
        /// </summary>
        /// <param name="count"></param>
        /// <returns></returns>
        private static string GetMaskString(int count)
        {
            string maskStr = "";
            if (count > 0)
            {
                for (int i = 1; i <= count; i++)
                {
                    maskStr += "*";
                }
            }
            return maskStr;
        }

        #region 身份证验证
        static string[] aCity = new string[] { null, null, null, null, null, null, null, null, null, null, null, "北京", "天津", "河北", "山西", "内蒙古", null, null, null, null, null, "辽宁", "吉林", "黑龙江", null, null, null, null, null, null, null, "上海", "江苏", "浙江", "安微", "福建", "江西", "山东", null, null, null, "河南", "湖北", "湖南", "广东", "广西", "海南", null, null, null, "重庆", "四川", "贵州", "云南", "西藏", null, null, null, null, null, null, "陕西", "甘肃", "青海", "宁夏", "新疆", null, null, null, null, null, "台湾", null, null, null, null, null, null, null, null, null, "香港", "澳门", null, null, null, null, null, null, null, null, "国外" };


        /// <summary>
        /// 验证18位身份证格式
        /// </summary>
        /// <param name="cid"></param>
        /// <returns>返回字符串,出错信息</returns>
        static string CheckCidInfo18(string cid)
        {
            double iSum = 0;
            System.Text.RegularExpressions.Regex rg = new System.Text.RegularExpressions.Regex(@"^\d{17}(\d|X|x)$");
            System.Text.RegularExpressions.Match mc = rg.Match(cid);
            if (!mc.Success)
            {
                return "您的身份证号码格式有误!";
            }
            cid = cid.ToLower();
            cid = cid.Replace("x", "a");
            if (aCity[int.Parse(cid.Substring(0, 2))] == null)
            {
                return "您的身份证号码格式有误!";//非法地区
            }
            try
            {
                DateTime.Parse(cid.Substring(6, 4) + "-" + cid.Substring(10, 2) + "-" + cid.Substring(12, 2));
            }
            catch
            {
                return "您的身份证号码格式有误!";//非法生日
            }
            for (int i = 17; i >= 0; i--)
            {
                iSum += (System.Math.Pow(2, i) % 11) * int.Parse(cid[17 - i].ToString(), System.Globalization.NumberStyles.HexNumber);

            }
            if (iSum % 11 != 1)
                return ("您的身份证号码格式有误!");//非法证号

            return "";

        }

        /// <summary>
        /// 验证15位身份证格式
        /// </summary>
        /// <param name="cid"></param>
        /// <returns></returns>
        static string CheckCidInfo15(string cid)
        {

            System.Text.RegularExpressions.Regex rg = new System.Text.RegularExpressions.Regex(@"^\d{15}$");
            System.Text.RegularExpressions.Match mc = rg.Match(cid);
            if (!mc.Success)
            {
                return "您的身份证号码格式有误!";
            }
            cid = cid.ToLower();
            cid = cid.Replace("x", "a");
            if (int.Parse(cid.Substring(0, 2)) > aCity.Length)
            {
                return "您的身份证号码格式有误!";//非法地区
            }
            if (aCity[int.Parse(cid.Substring(0, 2))] == null)
            {
                return "您的身份证号码格式有误!";//非法地区
            }
            try
            {
                DateTime.Parse(cid.Substring(6, 2) + "-" + cid.Substring(8, 2) + "-" + cid.Substring(10, 2));
            }
            catch
            {
                return "您的身份证号码格式有误!";//非法生日
            }
            return "";
        }

        /// <summary>
        /// 身份证验证
        /// </summary>
        /// <param name="cid">字符串</param>
        /// <returns>错误返回;错误信息,正确返回空字符</returns>
        public static string CheckIdentityCard(string cid)
        {
            if (cid == null)
            {
                return "请您输入身份证号!";
            }

            if (cid.Length == 18)
            {
                return CheckCidInfo18(cid);
            }
            if (cid.Length == 15)
            {
                return CheckCidInfo15(cid);
            }
            return "你输入的身份证格式错误";
        }

        #endregion


        /// <summary>
        /// 获取随机列表的数组
        /// </summary>
        /// <param name="total"></param>
        /// <returns></returns>
        public static int[] GetRamdomNumber(int minValue, int maxValue)
        {
            int total = maxValue - minValue;
            int[] array = new int[total];
            for (int i = 0; i < total; i++)
            { array[i] = i + minValue; }
            Random random = new Random();
            int temp2;
            int end = total;
            for (int i = 0; i < total; i++)
            {
                int temp = random.Next(minValue, maxValue);
                temp2 = array[temp - minValue];
                array[temp - minValue] = array[end - 1];
                array[end - 1] = temp2;
                end--;
            }
            return array;
        }

        /// <summary>
        /// 验证用户名称
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool CheckUserName(this string str)
        {
            if (str == null || str == "") return false;
            return Regex.IsMatch(str, RegexRule.UserName);
        }

        /// <summary>
        /// 验证用户昵称
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool CheckNickName(this string str)
        {
            if (str == null || str == "") return false;
            return Regex.IsMatch(str, RegexRule.NickName);
        }

        /// <summary>
        /// 验证子账号角色名称
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool CheckRoleName(this string str)
        {
            if (string.IsNullOrEmpty(str))
            {
                return false;
            }
            return Regex.IsMatch(str, RegexRule.RoleName);

        }

        /// <summary>
        /// 验证权限名称
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool CheckLimitName(this string str)
        {
            if (string.IsNullOrEmpty(str))
            {
                return false;
            }
            return Regex.IsMatch(str, RegexRule.AuthorityLimit);
        }

        /// <summary>
        /// 验证电子邮箱
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool CheckEmail(this string str)
        {
            if (str == null || str == "") return false;
            return Regex.IsMatch(str, RegexRule.Email);
        }

        /// <summary>
        /// 验证手机号码
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool CheckPhone(this string str)
        {
            if (str == null || str == "") return false;
            return Regex.IsMatch(str, RegexRule.Phone);
        }

        /// <summary>
        /// 验证手机号码和电话号码
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool CheckPhoneAndTelePhone(this string str)
        {
            if (str == null || str == "") return false;
            return Regex.IsMatch(str, RegexRule.PhoneAndTelePhone);
        }

        /// <summary>
        /// 字符串是否是QQ号码
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool isQQNum(this string str)
        {
            if (str == null || str == "") return false;
            return Regex.IsMatch(str, RegexRule.QQ);
        }

        /// <summary>
        /// 验证密码
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool CheckPwd(this string str)
        {
            if (str == null || str == "") return false;
            return Regex.IsMatch(str, RegexRule.PassWord);
        }

        /// <summary>
        /// 字符串是否数字
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool CheckNum(this string str)
        {
            if (str == null || str == "") return false;
            return Regex.IsMatch(str, RegexRule.Number);
        }

        /// <summary>
        /// 检查（短信、邮件）验证码格式
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool CheckDynCodeFormat(this string str, int length)
        {
            bool result = false;
            if (!string.IsNullOrEmpty(str))
            {
                if (str.Length == length)
                {
                    result = Regex.IsMatch(str, RegexRule.Number);
                }
            }
            return result;
        }

        /// <summary>
        /// 自定义用户验证
        /// </summary>
        /// <param name="str">实例本身</param>
        /// <param name="regex">正则表达式</param>
        /// <returns></returns>
        public static bool CheckOfRegex(this string str, string regex)
        {
            if (str == null || str == "") return false;
            return Regex.IsMatch(str, regex);
        }

        /// <summary>
        /// 将单引号转成双引号
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static string ConvertToDoubleQuotes(this string str)
        {
            try
            {
                return str.Replace("'", "\"");
            }
            catch //(ArgumentException ex)
            {
                return str;
            }
        }
        /// <summary>
        /// 为时间
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="format"></param>
        /// <returns></returns>
        public static string ToString(DateTime? dt, string format = "yyyy-MM-dd HH:mm:ss")
        {
            if (dt != null)
            {
                return ((DateTime)dt).ToString(format);
            }
            else
            {
                return null;
            }
        }

        /// <summary>
        /// 处理SQL语句中的单引号， 将一个单引号 ' 变成 '' 并将字符串的前后加上单引号
        /// 用于组装SQL语句，避免SQL脚本攻击
        /// 例如： SqlQ("aaaa'bbb") --> 'aaaa''bbb' 
        /// </summary>
        /// <param name="strTmp">源字符串</param>
        /// <returns>替换后的字符串</returns>
        public static string SqlQ(string strTmp)
        {
            string strT = strTmp;
            strT = strT.Replace("'", "''");
            strT = "'" + strT + "'";
            return strT;
        }

        public static string ConToBeginTime(string beginTime)
        {
            if (string.IsNullOrEmpty(beginTime))
            {
                beginTime = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd") + " 00:00:00";
            }
            else
            {
                beginTime = beginTime + " 00:00:00";
            }

            return beginTime;
        }

        public static string ConToEndTime(string endTime)
        {
            if (string.IsNullOrEmpty(endTime))
            {
                endTime = DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59";
            }
            else
            {
                endTime = endTime + " 23:59:59";
            }

            return endTime;
        }

        public static List<T> QueryByPage<T>(int PageSize, int CurPage, IList<T> objs) where T : new()
        {
            return objs.Take(PageSize * CurPage).Skip(PageSize * (CurPage - 1)).ToList();
        } 

    }
}
